package com.sds.shop.action;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sds.fw.mvc.Action;
import com.sds.fw.mvc.HttpUtil;
import com.sds.shop.dao.OrderDAO;
import com.sds.shop.vo.OrderVO;

public class OrderApproveAction extends Action {
	public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		try{
			String ord_no = request.getParameter("ord_no");
			String memId = request.getParameter("memId");
			OrderDAO.getInstance().approveOrder(ord_no);
			ArrayList<OrderVO> list = OrderDAO.getInstance().getOrderList(memId);			
			
			request.setAttribute("orderList", list);			
			HttpUtil.forward(request, response, "/jsp/orderList.jsp");
		}
		catch(Exception e){
			System.out.println("in OrderApproveAction" + e);
		}
	}

}
